﻿@model OKRs.Models.UserViewModels.UsersListViewModel

@{
    if (ViewData["Title"] == null)
    {
        ViewData["Title"] = "Users";
    }

    Layout = "~/Views/Shared/_Layout.cshtml";
}
<ol class="breadcrumb">
    <li><a asp-controller="Home" asp-action="Index">Home</a></li>
</ol>
<h3 class="clearfix">
    <span class="pull-left">@ViewData["Title"]</span>
    <a class="btn btn-sm btn-primary pull-right" asp-action="Create">
        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
        Add User
    </a>
</h3>

<table class="table">
    <tr>
        <th>Name</th>
        <th>Email</th>
        <th>Status</th>
        <th>&nbsp;</th>
    </tr>
    @foreach (var user in Model.Users)
    {
        <tr>
            <td>@user.Name</td>
            <td>@user.Email</td>
            <td>@(user.IsInactive ? "Inactive" : "Active" )</td>
            <td>
                <a class="btn btn-xs btn-primary" asp-action="Edit" asp-route-id="@user.Id">
                    <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                    Edit
                </a>
            </td>
        </tr>

    }
</table>

